<?php
namespace app\common\controller;
use think\Config;
use think\Controller;

class Frontend extends Controller
{
    /**
     * 布局模板
     * @var string
     */
    protected $layout = 'default';
    protected $theme = 'default';
    protected $side = 'profile';

    public function _initialize()
    {
        defined('SKIN_PATH') or define('SKIN_PATH', '/frontend/');
        $this->view->config('view_base', ROOT_PATH.'template'.DS.$this->theme.DS);
        $this->view->config('view_depr', '_')->config('view_path', $this->theme);
        // 如果有使用模板布局
        if ($this->layout) {
            $this->view->engine->layout('layout@'. $this->layout);
        }
        Config::set('dispatch_success_tmpl', APP_PATH . 'common' . DS . 'view' . DS . 'tpl' . DS . 'wap_dispatch_jump.tpl');
        Config::set('dispatch_error_tmpl', APP_PATH . 'common' . DS . 'view' . DS . 'tpl' . DS . 'wap_dispatch_jump.tpl');
    }
}
